<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
        <meta name="author" content="Coderthemes">

        <link rel="shortcut icon" href="__STATIC__/assets/images/favicon.ico">

        <title>Adminto - Responsive Admin Dashboard Template</title>

        <!--Morris Chart CSS -->
        <link rel="stylesheet" href="__STATIC__/assets/plugins/morris/morris.css">

        <!-- App css -->
        <link href="__STATIC__/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="__STATIC__/assets/css/icons.css" rel="stylesheet" type="text/css" />
        <link href="__STATIC__/assets/css/style.css" rel="stylesheet" type="text/css" />
        <link href="__STATIC__/layer/layui.css" rel="stylesheet" type="text/css" />
        <script src="__STATIC__/assets/js/modernizr.min.js"></script>

        <link href="__STATIC__/assets/plugins/responsive-table/css/rwd-table.min.css" rel="stylesheet" type="text/css" media="screen">

        <!-- App css -->
        <link href="__STATIC__/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="__STATIC__/assets/css/icons.css" rel="stylesheet" type="text/css" />
        <link href="__STATIC__/assets/css/style.css" rel="stylesheet" type="text/css" />


        <link href="__STATIC__/assets/plugins/summernote/summernote-bs4.css" rel="stylesheet" /><!-- Custom box css -->
        <link href="__STATIC__/assets/plugins/custombox/dist/custombox.min.css" rel="stylesheet">

        
        <script src="assets/js/modernizr.min.js"></script>
        <style>
            table th{
                text-align: center;
            }
            table td{
                text-align: center;
                white-space:inherit;
                line-height: 100px;
            }

            a{
                color:#5383c3;
            }
        </style>
    </head>


    <body class="fixed-left">

        <!-- Begin page -->
        <div id="wrapper">

            <!-- Top Bar Start -->
            <div class="topbar">

                <!-- LOGO -->
                <div class="topbar-left">
                    <a href="{:url('Index/index')}" class="logo"><span>do,re,<span>mi</span></span><i class="mdi mdi-layers"></i></a>
                </div>

                <!-- Button mobile view to collapse sidebar menu -->
                <div class="navbar navbar-default" role="navigation">
                    <div class="container-fluid">

                        <!-- Page title -->
                        <ul class="nav navbar-nav list-inline navbar-left">
                            <li class="list-inline-item">
                                <button class="button-menu-mobile open-left">
                                    <i class="mdi mdi-menu"></i>
                                </button>
                            </li>
                            <li class="list-inline-item">
                                <h4 class="page-title">商品列表 :</h4>
                            </li>
                        </ul>

                        <nav class="navbar-custom">

                            <ul class="list-unstyled topbar-right-menu float-right mb-0">

                                <li>
                                    <!-- Notification -->
                                    <div class="notification-box">
                                        <ul class="list-inline mb-0">
                                            <li>
                                                <a href="javascript:void(0);" class="right-bar-toggle">
                                                    <i class="mdi mdi-bell-outline noti-icon"></i>
                                                </a>
                                                <div class="noti-dot">
                                                    <span class="dot"></span>
                                                    <span class="pulse"></span>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- End Notification bar -->
                                </li>

                                <li class="hide-phone">
                                    <form class="app-search">
                                        <input type="text" placeholder="Search..."
                                               class="form-control">
                                        <button type="submit"><i class="fa fa-search"></i></button>
                                    </form>
                                </li>

                            </ul>
                        </nav>
                    </div><!-- end container -->
                </div><!-- end navbar -->
            </div>
            <!-- Top Bar End -->


            <!-- ========== Left Sidebar Start ========== -->
            {include file="public/left"}
            <!-- Left Sidebar End -->



            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <div class="content-page">
                <!-- Start content -->
                <div class="content">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-12">
                                <div class="card-box">
                                    <a href="{:url('Commodity/brand_add')}" style="color:#fff;"><button type="button" class="btn btn-primary btn-bordred waves-effect w-md waves-light m-b-5">新增品牌</button></a>

                                    <div class="table-rep-plugin">
                                        <div class="table-responsive" data-pattern="priority-columns">
                                            <table id="tech-companies-1" class="table  table-striped">
                                                <thead>
                                                <tr>
                                                    <!-- <th>序号</th> -->
                                                    <th data-priority="1">封面</th>
                                                    <!-- <th data-priority="3">名称</th> -->
                                                    <th data-priority="3">品牌名称</th>
                                                    <th data-priority="1">所属分类</th>
                                                    <th data-priority="3">操作</th>
                                                    
                                                </tr>
                                                </thead>
                                                <tbody>
                                                {volist name="list" id="v"}
                                                <tr>
                                                   <!-- <td>{$v.id}</td> -->
                                                   <td><img src="__ROOT__/{$v.brand_img}" alt="" style="width:25%;height:65%;"></td>
                                                   <td style="font-size:18px;color:#000;"><b>{$v.brand_name}</b></td>
                                                   <td style="font-size:18px;color:#000;">{$v.class_name}</td>
                                                    
                                                   <td><a href="{:url('Commodity/brand_edit',array('id'=>$v.brand_id))}">编辑</a> | <a style="color:#5383c3;cursor:pointer" onclick="del({$v.brand_id},this)">删除</a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                           </table>
                                        </div>

                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- end row -->
                    </div> <!-- container -->

                </div> <!-- content -->

                <footer class="footer text-right">
                    2016 - 2018 © Adminto. Coderthemes.com
                </footer>

            </div>


            <!-- ============================================================== -->
            <!-- End Right content here -->
            <!-- ============================================================== -->


            <!-- Right Sidebar -->
            
            <!-- /Right-bar -->

        </div>
        <!-- END wrapper -->
    
     

        <!-- responsive-table-->
        <script src="__STATIC__/assets/plugins/responsive-table/js/rwd-table.min.js" type="text/javascript"></script>
        <!-- jQuery  -->
        <script src="__STATIC__/assets/js/jquery.min.js"></script>
        <script src="__STATIC__/assets/js/popper.min.js"></script>
        <script src="__STATIC__/assets/js/bootstrap.min.js"></script>
        <script src="__STATIC__/assets/js/detect.js"></script>
        <script src="__STATIC__/assets/js/fastclick.js"></script>
        <script src="__STATIC__/assets/js/jquery.blockUI.js"></script>
        <script src="__STATIC__/assets/js/waves.js"></script>
        <script src="__STATIC__/assets/js/jquery.nicescroll.js"></script>
        <script src="__STATIC__/assets/js/jquery.slimscroll.js"></script>
        <script src="__STATIC__/assets/js/jquery.scrollTo.min.js"></script>
        <script src="__STATIC__/layer/layer.js"></script>

        <!-- KNOB JS -->
        <!--[if IE]>
        <script type="text/javascript" src="__STATIC__/assets/plugins/jquery-knob/excanvas.js"></script>
        <![endif]-->
        <script src="__STATIC__/assets/plugins/jquery-knob/jquery.knob.js"></script>

        <!--Morris Chart-->
        <script src="__STATIC__/assets/plugins/morris/morris.min.js"></script>
        <script src="__STATIC__/assets/plugins/raphael/raphael-min.js"></script>

        <!-- Dashboard init -->
        <script src="__STATIC__/assets/pages/jquery.dashboard.js"></script>

        <!-- App js -->
        <script src="__STATIC__/assets/js/jquery.core.js"></script>
        <script src="__STATIC__/assets/js/jquery.app.js"></script>
        <script> 
            function tiao(id,obj)
            {
                // console.log(id);
                location.href="{:url('Commodity/paging')}"+'?id='+id;
                
            }
            $(function() {
                $('.table-responsive').responsiveTable({
                    addDisplayAllBtn: 'btn btn-secondary'
                });

            });


            function del(pid,obj)
            {
                // console.log(pid);
                //询问框
                layer.confirm('确定删除么 ( ・◇・)？', {
                  btn: ['确定','取消'] //按钮
                }, function(){
                     $.ajax({
                         type: "POST",
                         url:"{:url('Commodity/brand_del')}",
                         data:{'id':pid},
                         beforeSend:function(){
                                layer.load(0, {shade: false});
                            },
                         success: function(msg) {
                            // console.log(msg);
                            if (msg == 111) {
                                layer.msg('删除成功', {icon: 1});
                                history.go(0); 
                            }else{
                                layer.msg('删除失败!');
                            }
                         },
                         complete: function() {
                                 layer.closeAll('loading');
                            }
                    });
                 
                }, function(){
                    layer.msg(' (｡・`ω´･) 再见');
                });
                
            }
        </script>
    </body>
</html>